package io.renren.modules.course.controller;

import io.renren.common.utils.R;
import io.renren.modules.course.entity.CourseClassificationEntity;
import io.renren.modules.course.service.CourseClassificationService;
import io.renren.modules.sys.entity.SysMenuEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("course/classification")
public class CourseClassificationController {

    @Autowired
    private CourseClassificationService courseClassificationService;


    @RequestMapping("getClassification")
   // @RequiresPermissions("course:classification:getClassification")
    public R getClassification(@RequestBody Map map){
        List<CourseClassificationEntity> page = courseClassificationService.getClassification(map);
        return R.ok().put("page", page);
    }

    @RequestMapping("getClassificationList")
    // @RequiresPermissions("course:classification:getClassification")
    public  List<CourseClassificationEntity>  getClassificationList(){
        List<CourseClassificationEntity> page = courseClassificationService.getClassificationList();
        return page;
    }


    @RequestMapping("getClassificationTree")
    // @RequiresPermissions("course:classification:getClassification")
    public R getClassificationTree(){
//查询列表数据
        List<SysMenuEntity> menuList = courseClassificationService.queryNotButtonList();
        return R.ok().put("menuList", menuList);
    }
}
